import Vue from 'vue'
import VueRouter from "vue-router";

const Home = () => import('../components/Home')

const Login = () => import('../pages/LoginPage')

const InfoPage = () => import('../pages/InfoPage')
const Book = () => import('../pages/BookPage')
const Type = () => import('../pages/TypePage')
const Borrow = () => import('../pages/BorrowPage')
const User = () => import('../pages/UserPage')


Vue.use(VueRouter)
const routes=[
  {
    path: '/',
    component: Login,
  },
  {
    path: '/Home',
    component: Home,
    children: [
      {
        path: 'info',
        component: InfoPage,
      },
      {
        path: 'book',
        component: Book,
      },
      {
        path: 'type',
        component: Type,
      },
      {
        path: 'borrow',
        component: Borrow,
      },
      {
        path: 'user',
        component: User,
      },
    ]
  },
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router
